<?php

/**
 * 
 * 充值管理
 * @author alang
 *
 */

class Recharge extends Base_Controller
{
	
	
	public function __construct()
	{
		parent::__construct();
		$this->load->model('recharge_mdl','recharge');
	}
	
	
	public function index()
	{
		
				/*分页设置*/
		$ptype = intval($this->uri->rsegment(4));
		$page = $this->uri->rsegment(6);
	
		$page = ($page && is_numeric($page)) ? intval($page) : 1;
		$limit = 1000;
		$offset = ($page - 1) * $limit;
		$pagination = '';
	
		$count = $this->recharge->getRechargeCount();
	
		$this->load->library('pagination');
		$config['base_url'] = base_url().'/adminroot/recharge/index';
		$config['total_rows'] = $count;
		//设置url上第几段用于传递分页器的偏移量
		$config ['uri_segment'] = 6;	 
		$config['per_page'] = $limit; 
		$config['use_page_numbers'] = TRUE;
		$this->pagination->initialize($config); 
				
		$data = array();
		$data['list'] = $this->recharge->getRechargeList(false,$limit, $offset,'DESC');
	
		$data['page'] = $this->pagination->create_links();	
		
		$this->load->view('adminroot/list_recharge',$data);
	}
}